using System.Collections.Generic;

namespace AGame.TabOrm
{
    public interface IRepository<T, in TKey>
    {
        void RefreshTab();
        
        bool Add(T obj);

        bool Set(T obj, bool needInit = false);

        bool Remove(T obj);

        bool RemoveAt(int index);

        bool ContainsKey(params TKey[] id);

        List<T> GetDataList(params TKey[] id);

        T GetDataById(params TKey[] id);

        bool TryGetDataById(out T res, params TKey[] id);

        T GetDataByIndex(int index);

        bool SetDataId(T obj, params TKey[] id);

        void Destroy();
        
        
#if UNITY_EDITOR
        void WriteTab();
#endif
    }
}